﻿namespace OboutInc.ImageZoom
{
    using System;
    using System.Collections;
    using System.Reflection;

    public class AdapterCollection : DictionaryBase
    {
        public void Add(Type key, AdapterBuilder value)
        {
            base.Dictionary.Add(GetKey(key), value);
        }

        public bool Contains(Type key)
        {
            return base.Dictionary.Contains(GetKey(key));
        }

        private static string GetKey(Type key)
        {
            return key.FullName;
        }

        public void Remove(Type key)
        {
            base.Dictionary.Remove(GetKey(key));
        }

        public AdapterBuilder this[Type key]
        {
            get
            {
                return (AdapterBuilder) base.Dictionary[GetKey(key)];
            }
            set
            {
                base.Dictionary[GetKey(key)] = value;
            }
        }
    }
}

